import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 74646
 * Date: 2022-01-24
 * Time: 21:56
 */

class Person{
    //字段 -》属性 -》成员变量 ->定义在类的内部，方法的外部
    public String name ;
    public int age;
    public static int count;

    //方法 -》行为
    public void eat(){
        System.out.println(name+"正在吃饭");
    }
    public void sleep(){
     System.out.println(name+"正在睡觉");
    }
}
public class TestDemo2 {
    public static void move(char post1, char post2) {
        System.out.print(post1 + " -> " + post2 + "   ");
    }

    /**
     * @param n     盘子个数
     * @param post1 移动的起始位置
     * @param post2 移动的中转位置
     * @param post3 移动的结束位置
     */
    public static void hanio(int n, char post1, char post2, char post3) {
        if (n == 1) {
            move(post1, post3);
        } else {
            hanio(n - 1, post1, post3, post2);
            move(post1, post3);
            hanio(n - 1, post2, post1, post3);
        }
    }

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        for (int i = 1; i <= n; i++) {
            hanio(i, 'A', 'B', 'C');
            System.out.println();
        }
    }

    public static void main3(String[] args) {
        Person person1 = new Person();
        person1.age++;
        System.out.println("person1->age " + person1.age);
        Person.count++;
        System.out.println("person1->count " + Person.count);
        System.out.println("-------------------");
        Person person2 = new Person();
        person2.age++;
        System.out.println("person2->age " + person2.age);
        Person.count++;
        System.out.println("person2->count " + Person.count);
    }

    public static void main2(String[] args) {

        Person person = new Person();
        person.name = "张三";
        person.age = 20;
        person.eat();
        person.sleep();
    }

    public static void main1(String[] args) {
        Person person = new Person();//通过new实例化对象
        person.eat();//成员方法调用需要通过对象的引用调用
        person.sleep();
        //产生对象 实例化对象
        Person person2 = new Person();
        //普通成员变量的访问需要通过对象的引用类访问
        System.out.println(person.name);
    }
}
